From e91a0c181cad80468b5cd37545573ec54a8e1800 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Thu, 27 Mar 2025 13:07:37 +0100 Subject: [PATCH] gui/macOS: Properly retain/release NSFileProviderManager(s) Signed-off-by: Claudio Cambra --- src/gui/macOS/fileprovidereditlocallyjob_mac.mm | 2 ++ src/gui/macOS/fileprovideritemmetadata_mac.mm | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gui/macOS/fileprovidereditlocallyjob_mac.mm b/src/gui/macOS/fileprovidereditlocallyjob_mac.mm index ec5ffcc75..483fc08ec 100644 --- a/src/gui/macOS/fileprovidereditlocallyjob_mac.mm +++ b/src/gui/macOS/fileprovidereditlocallyjob_mac.mm @@ -55,6 +55,7 @@ void FileProviderEditLocallyJob::openFileProviderFile(const QString &ocId) emit notAvailable(); } + [manager retain]; [manager getUserVisibleURLForItemIdentifier:nsOcId completionHandler:^(NSURL *const url, NSError *const error) { @@ -81,6 +82,7 @@ void FileProviderEditLocallyJob::openFileProviderFile(const QString &ocId) emit notAvailable(); }); } + [manager release]; }]; } diff --git a/src/gui/macOS/fileprovideritemmetadata_mac.mm b/src/gui/macOS/fileprovideritemmetadata_mac.mm index 9a4e00c89..8b79a60bd 100644 --- a/src/gui/macOS/fileprovideritemmetadata_mac.mm +++ b/src/gui/macOS/fileprovideritemmetadata_mac.mm @@ -132,6 +132,7 @@ QString FileProviderItemMetadata::getUserVisiblePath() const // getUserVisibleUrl is async, so wait here + [manager retain]; [manager getUserVisibleURLForItemIdentifier:nsItemIdentifier completionHandler:^(NSURL *const userVisibleFile, NSError *const error) { @@ -141,6 +142,7 @@ QString FileProviderItemMetadata::getUserVisiblePath() const returnPath = QString::fromNSString(userVisibleFile.path); } + [manager release]; dispatch_semaphore_signal(semaphore); }]; -- 2.30.2